﻿module Sustainalytics.Common {

    var mod = angular.module(commonModuleName);

    var directive = function ($document) {
        return {
            restrict: 'A',
            link: function (scope, elem, attr: any, ctrl) {
                elem.bind('click', function (e) {
                    e.stopPropagation();
                });
                $document.bind('click', function () {
                    scope.$apply(attr.hideLogin);
                })
            }
        }
    };

    mod.directive('hideLogin', [ '$document', directive ]);
}